package com.slxy.annonation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Text {
    private static void a(){
        // 加载扫描
        ApplicationContext context
                = new AnnotationConfigApplicationContext("com.slxy.annonation");
        DemoA a = context.getBean("demoA", DemoA.class);
        a.a();

    }
    private static void b(){
        ApplicationContext context=new AnnotationConfigApplicationContext("com.slxy.annonation");
        DemoB b = context.getBean("db", DemoB.class);
        System.out.println(b);
    }
    private static void c(){
        ApplicationContext context=new AnnotationConfigApplicationContext("com.slxy.annonation");
        DemoC c = context.getBean("dc", DemoC.class);
        System.out.println(c);
    }
    private static void d(){
        ApplicationContext context=new AnnotationConfigApplicationContext("com.slxy.annonation");
        DemoD b = context.getBean("demoD", DemoD.class);
        System.out.println(b);
    }
    private static void e() {
        // 加载扫描
        ApplicationContext context
                = new AnnotationConfigApplicationContext("com.slxy.annonation");
        DemoF f = context.getBean(DemoF.class);
        f.f();
    }
    public static void main(String[] args) {
    e();
    }
}
